<?php 
include_once '../sys/com/model/db/ProductDAO.php';
?>
<?php 
$pst_id = 16;
if(isset($_GET["pst_id"])){
	$pst_id = $_GET["pst_id"];
}
$productDAO = new ProductDAO();
$result = $productDAO->queryAllBySubType($pst_id, "sort", "desc");

$picFront = "../admin/product/images/";
$hrefFront = "../List_pages/contant/content.php?pa_id=";

$pic0 = $picFront."spacer.gif";
$href0 = "javascript:;";
$title0 = "";
$price0 = "";
if(count($result)>0){
	$product0 = $result[0];
	$pic0 = $picFront.$product0->{"pic"};
	$href0 = $hrefFront.$product0->{"p_id"};
	$title0 = $product0->{"title"}."...";
	$price0 = number_format($product0->{"price"})."元";
}

$pic1 = $picFront."spacer.gif";
$href1 = "javascript:;";
$title1 = "";
$price1 = "";
if(count($result)>1){
	$product1 = $result[1];
	$pic1 = $picFront.$product1->{"pic"};
	$href1 = $hrefFront.$product1->{"p_id"};
	$title1 = $product1->{"title"}."...";
	$price1 = number_format($product1->{"price"})."元";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>3C專區</title>
<style type="text/css">
<!--
a:link {
	color: #FFFFFF;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #FFFFFF;
}
a:hover {
	text-decoration: none;
	color: #999999;
}
a:active {
	text-decoration: none;
	color: #333333;
}
.style1 {
	font-size: 12px;
	color: #FFFFFF;
}
.style2 {font-size: 12px}
.style3 {color: #666666}
.style5 {color: #333333}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>

<body>
<table width="289" height="197" border="0" cellpadding="0" cellspacing="0" background="../images/index_PcDigital_bg_02.png">
  <tr>
    <td height="32" valign="middle"><table width="289" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="58" align="center" class="style1"><span class="style<?php echo $pst_id==16?'1':'2'?>"><a href="?pst_id=16">筆電</a></span></td>
        <td width="58" align="center" class="style1"><span class="style<?php echo $pst_id==17?'1':'2'?>"><a href="?pst_id=17">品牌PC</a></span></td>
        <td width="58" align="center" class="style1"><span class="style<?php echo $pst_id==18?'1':'2'?>"><a href="?pst_id=18">數位/影音</a></span></td>
        <td width="58" align="center" class="style1"><span class="style<?php echo $pst_id==19?'1':'2'?>"><a href="?pst_id=19">電腦周邊</a></span></td>
        <td width="57" align="center" class="style1"><span class="style<?php echo $pst_id==20?'1':'2'?>"><a href="?pst_id=20">其他3C商品</a></span></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="165" valign="middle"><table width="289" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="145" align="center"><table width="100" height="154" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="100" height="100" align="center"><table width="100" border="0" cellpadding="0" cellspacing="0" background="../images/index_LCAP_box.png">
                  <tr>
                    <td height="100" align="center" valign="middle">
                    	<a href="<?php echo $href0?>" target="_top"><img src="<?php echo $pic0?>" width="95" height="95" alt="<?php echo $title0?>" style="background-color: #FF0000" /></a>
                    </td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td height="30"><span class="style2 style3"><?php echo $title0?></span></td>
              </tr>
              <tr>
                <td height="15"><span class="style2 style5"><?php echo $price0?></span></td>
              </tr>
          </table></td>
        <td width="144" align="center"><table width="100" height="154" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="100" height="100" align="center"><table width="100" border="0" cellpadding="0" cellspacing="0" background="../images/index_LCAP_box.png">
                  <tr>
                    <td height="100" align="center" valign="middle">
                    	<a href="<?php echo $href1?>" target="_top"><img src="<?php echo $pic1?>" width="95" height="95" alt="<?php echo $title1?>" style="background-color: #FF0000" /></a>
                    </td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td height="30"><span class="style2 style3"><?php echo $title1?></span></td>
              </tr>
              <tr>
                <td height="15"><span class="style2 style5"><?php echo $price1?></span></td>
              </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
